import shapefile
import glob

w = shapefile.Writer("shapefiles/Merged")
r = shapefile.Reader("shapefiles/footprints/footprints_185")
w.fields = list(r.fields[1:])
# 1.遍历文件
files = glob.glob("shapefiles/footprints/footprints_*")
for filePath in files:
    r = shapefile.Reader(filePath)
    # 2.复制记录（属性）
    for itme in r.iterShapeRecords():
        w.record(*itme.record)
    # 3. 复制图形信息
    for s in r.iterShapes():
        w.poly([s.points])
    # 等待时间有点久
w.close()
r.close()

r = shapefile.Reader("shapefiles/Merged")
print(r)
r.close()